package imagedemo;

import java.awt.Color;
import java.io.File;
import java.io.IOException;

import org.junit.Test;

public class ImageTest {
	
	@Test
	public void test() throws IOException{
		String imgPath="image"+File.separator+"re_IMG_2777.JPG";
		ImageHandler handler = new ImageHandler();
		
		//wihte
		int white=new Color(255,255,255).getRGB();
		int black=new Color(0,0,0).getRGB();
		
//		handler.removeRgbRange(imgPath, white,handler.getAverageRgbNoWhite(imgPath) );
		handler.removeRgbRange(imgPath, white, (int) (handler.getAverageRgbNoWhite(imgPath)));
		handler.deepenRgbRange(imgPath, handler.getAverageRgbNoWhite(imgPath), black);
		handler.turnGray(imgPath);
		handler.turnBinary(imgPath);
		
	}
}
